import { BroadCastCall } from "../../broadCast/BroadCastCall";
import { MessageBlock } from "../../../../../Framework/MQ/MessageBlock";
import { SEntityId } from "../../../../../Message/Public/SEntityId";
import { Cache } from "../../../cache/Cache";
import { MsgManager } from "../../../manager/MsgManager";
import { Language } from "../../../../../extend/language/Language";
import { NetDispatcher } from "../../../../mvc/core/NetDispatcher";
import { ServerCommand } from "../../../mvc/ServerCommand";
//class GroupModifyCaptainCommand
    
    export  class GroupModifyCaptainCommand extends BroadCastCall
    {
        constructor(arg1: Object)
        {
            super(arg1);
            return;
        }

        public /* override */ call(arg1: MessageBlock): void
        {
            super.call(arg1);
            var loc1=arg1.messageBase as SEntityId;
            _cache.group.captain = loc1;
            if (loc1.id == Cache.instance.role.entityInfo.entityId.id) 
            {
                MsgManager.showRollTipsMsg(Language.getString(62033));
            }
            NetDispatcher.dispatchCmd(ServerCommand.Group_CaptainChange, _cache.group.captain);
            return;
        }
    }
